var mongoose=require('mongoose');
var Post=mongoose.model('Post',{
    title:String,
    authors:[String],
    comments:[
        {
            content:String,
            like:Number
        }
    ],
    slice:Array
});
var db=mongoose.connect('mongodb://localhost/MongoDB_QuanWei_2');

Post.update({
    title:'post3'
},{
    author:['Tom'],
    comments:[
        {
            content:'c1',
            like:0
        }
    ]
},{upsert:true},(err,r)=>{
    console.log(err,r);

        Post.find({title:{$ne:'post 1'}},(e,r)=>{
            console.log(e,r);//null { ok: 1, nModified: 1, n: 1 }
            process.exit(1);
        });
});
/*
* {field:{$ne:val}
*
* 不等于
* */





